 		ORG 100
		LDA I
		OUT
		LDA N 
		OUT
		LDA ONE
		OUT
		LDA QUEST
		OUT
		LDA SPC
		OUT
FIRST,		INP
		OUT
		STA CIFRA
		STA IN1SUB
		LDA CR
		STA IN2SUB
		BSA SUB
		LDA OUTSUB
		SZA
		BUN NEXT1
		LDA I
		OUT
		LDA N
 		OUT
		LDA TWO
		OUT
		LDA QUEST
		OUT
		LDA SPC
		OUT
SECOND,		INP
		OUT
		STA CIFRA
		STA IN1SUB
		LDA CR
		STA IN2SUB
		BSA SUB
		LDA OUTSUB
		SZA
		BUN NEXT2
		LDA CR
		OUT
		LDA O
		OUT
		LDA UCH
		OUT
		LDA T
		OUT
		LDA SPC
		OUT
		LDA NUM1
		STA IN1MUL
		LDA NUM2
		STA IN2MUL
		BSA MUL
		LDA OUTMUL
		STA IN
		SPA
		BUN FINEUU
		BSA MCDU
		LDA U
		STA UU
		LDA MCD
		SPA
		BUN FINEUU
		STA IN
		BSA MCDU
		LDA U
		STA D
		LDA MCD
		SPA
		BUN FINED
		STA IN
		BSA MCDU
		LDA U
		STA C
		LDA MCD
		SPA
		BUN FINEC
		STA IN
		BSA MCDU
		LDA U
		STA M
		LDA MCD
		SPA
		BUN FINEM
		STA IN
		BSA MCDU
		LDA U
		STA MM
		LDA MM
		ADD OFFP
		OUT
FINEM,		LDA M
		ADD OFFP
		OUT
FINEC,		LDA C
		ADD OFFP
		OUT
FINED,		LDA D
		ADD OFFP
		OUT
FINEUU,		LDA UU
		ADD OFFP
		OUT
		HLT
OFFP,		DEC 48


MCDU,		DEC 0
		CLA
		STA MCD
		STA U
INIT,		LDA IN
		ADD TEN
		STA TMCDU
		SPA
		BUN UNIT
		STA IN
		ISZ MCD
		BUN INIT
UNIT,		LDA TMCDU
		SZA
		BUN END
		ISZ MCD
		CLA
		STA U
		BUN MCDU I
END,		LDA IN
		STA U
		BUN MCDU I
TEN,		DEC -10
TMCDU,		DEC 0
IN,		DEC 0
MCD,		DEC 0
U,		DEC 0
MM,		DEC 0
M,		DEC 0
C,		DEC 0
UU,		DEC 0

NEXT1,		LDA DX
		STA IN1MUL
		LDA NUM1
		STA IN2MUL
		CLA
		BSA MUL
		LDA OUTMUL
		ADD CIFRA
		ADD OFF
		STA NUM1
		BUN FIRST
NEXT2,		LDA DX
		STA IN1MUL
		LDA NUM2
		STA IN2MUL
		BSA MUL
		LDA OUTMUL
		ADD CIFRA
		ADD OFF
		STA NUM2
		BUN SECOND
DX,		DEC 10
I,		DEC 73
N,		DEC 78
O,		DEC 79
UCH,		DEC 85
T,		DEC 84
ONE,		DEC 49
TWO,		DEC 50
QUEST,		DEC 63
SPC,		DEC 32
CR,		DEC 13
NUM1,		DEC 0
NUM2,		DEC 0
CIFRA,		DEC 0
OFF,		DEC -48


MUL,		DEC 0
		CLA
		STA OUTMUL
		LDA IN2MUL
		SPA
		BUN MUL I
		CMA
		INC
		STA IN2MUL
START,		LDA IN1MUL
		ADD OUTMUL
		STA OUTMUL
		ISZ IN2MUL
		BUN START
		BUN MUL I
IN1MUL,		DEC 0
IN2MUL,		DEC 0
OUTMUL,		DEC 0


SUB,		DEC 0
		LDA IN2SUB
		CMA
		INC
		ADD IN1SUB
		STA OUTSUB
		BUN SUB I
IN1SUB,		DEC 0
IN2SUB,		DEC 0
OUTSUB, 	DEC 0


		END



